const { createTask } = require("../../aaa")
const { plugin } = require("../../../../common/utils")

exports.createMatchTemplateTask = function(config, callback) {
    let task = createTask(
        Object.assign({}, config || {}, {interval: 200}), 
        (args, context) => {
            let capture = images.captureScreen()
            if (capture == undefined) {
                return false
            }
            let bitmap = capture.getBitmap()
            let result = plugin.match(bitmap, args.templates, args.bounds)
            console.log("识别结果:" + JSON.stringify(result))
            return result
        }, 
        callback
    ) 
    return task
}